FTPd v2.2.0 & FTPd Setup v2.2.0 ⌐ 1992-93 Peter Lewis.
These programs are $10 Shareware.
FTPd is dedicated to werner@rascal for his many years of devotion to the Macintosh Internet community. You have our thanks!
Ñ Contents
What FTPd Does
Features
Using FTPd Setup
Using FTPd
Gopher
Security Considerations
Remote Site Access Restrictionsá
How to Avoid Being Killed by your Network Administrator
Limitations
Small Print
Warrantyá
Fine Printá
Acknowledgementsá
How It Worksá
Version Historyá
The Author
áThese sections are in FTPd Extra Documentation. TeachText doesn╒t handle more than 32k, and I didn╒t want to rely on any other editor.
Ñ What FTPd Does
FTPd is a Macintosh implementation of the Un*x FTP and Gopher server protocol. It should be compatible with most FTP clients, and all gopher clients. Basically it allows your mac to act as an FTP server so you (and others) can access your files from anywhere around the world. Obviously there are some serious security considerations you should look in to before using this software (see the Security Considerations section). FTPd requires System 7, MacTCP 1.1, and File Sharing enabled. It honours the Users&Groups privileges and passwords, and supports multiple logins, anonymous FTP (user name anonymous or ftp), as well as MacBinary and BinHex transfers, and the ╥MACB╙ FTP command. You can run ╥FTPd╙ as a foreground application (displaying the log), or ╥FTPd (Background)╙ as a background only application.
Ñ╩Features
Support both Gopher and FTP connections.
Multiple simultaneous users.
Honours System 7 Users & Groups (in fact depends on them!).
Suports BinHex and MacBinary transfers, including the MACB command.
Supports Alias resolution for directories and files.
Allows login to other AppleShare servers on the local network.
Allows different formats of a file to be fetched.
Pattern matching in change directory command.
Individual initial directory for any user.
FTP site descriptions sent after login.
Directory descriptions sent after CD command.
Supports the CatSearch feature to allow very fast volume wide searches.
Remote site access restrictions
ISO international character translation
Allows setting of the owner, group and access permissions of directories.
Allows users to change passwords on all logged in servers.
Supports Scrambled&Two-way passwords.
Supports process control (launching, listing or quiting applications).
Runs in the foreground or the background.
Ñ╩Using FTPd Setup
Before you can run FTPd, you must be running System 7, with File Sharing turned on, and you must set up File Sharing to give appropriate privileges to users and guests (including enabling guest logins if you want to allow anonymous logins).
Then you need to run FTPd Setup. This is pretty cryptic, but you don╒t have to use it very often (which probably makes it worse:-). The main thing to set up is the privileges you want for each user on each type of volume.
There are three types of users:
Owner - The macintosh owner (as defined by the Users & Groups owner name).
User - Anybody with a user name and password set up in the U&G settings.
Guest - Anonymous logins (username of ╥ftp╙ or ╥anonymous╙, any password)
and Four types of volumes:
Shared Folders - The local shared folders. This includes any volumes or folders that you explicitly marked as shared using 'Sharing╔' in the Finder, or if you are the owner and ╥See entire volume╙ is set then it refers to the local volumes.
Mounted - Currently mounted volumes from other servers.
Servers - Any shared volumes from other servers in your zone or from mounted servers.
Far Servers - Any shared volumes for servers in other zones.
Note: If you enable any privileges to any Far Servers it may take a VERY long time to log in (on my network (mostly LocalTalk, 7 zones) it takes 2 minutes, I've had another report that on a network with around 80 zones it took 9 minutes). During this time FTPd will not do anything else. Basically unless you have a small fast network and you REALLY need this facility I suggest you leave all Far Server privileges set to None.
Note: FTPd works fine with CAP servers, but you╒ll have to enable Clear Text passwords in the Preferences window. This is a slight security flaw, since it means FTPd will send your password in clear text to any potential server. Of course, this is only relevent if you allow access to non-Local Mounted volumes, Servers or Far Servers. I╒m told it works fine running on an AppleShare 3 server as well.
and finally there are four privileges:
None - No access.
Read Only - Access to read existing files, but no write access.
Upload - Access to read existing files, and add things to the file system, but not change what is already there (including not overwriting existing files).
Full - Full access to the file system, read/write files, delete files and (empty) directories, rename files.
As well as the privileges you can set when the various users can connect (depending on the idle time of the mac, as well as refusing connections for a period of the day).
Note: All privileges are contingent on having the appropriate privileges through AppleShare. Thus if a particular user can't access a particular volume using AppleShare they won't be able to through FTPd either (even if you give them Full access).
Then you can choose User Directories from the file menu and set the startup directory for any users (Important note: this is simply an initial directory, it in no way restricts the access of the user to that directory. The user can immediately change in to any other directory). The default directory will be used for all unspecified users. The user ╥anonymous╙ represents Guest logins using either the name ╥ftp╙ or ╥anonymous╙.
Finally, if you can set some other preferences via the Preferences menu command, including whether to honour the copy inhibit state (which disallows fetching of copy inhibited files), whether to honour invisible files (which stops them from being displayed in the directory listing, though you can still get them if you know their name) whether to start in MacBinary mode, and what creator application to use for created ASCII files. Most of the rest are pretty technical, if you don╒t understand them, don╒t fiddle with them! The speed setting determines how much memory is used for each connection, if you have a slow link then there is no sense wasting lots of memory on buffers. This parameter affects the amount of memory allocated and thus maximum speed for transfers into your Mac (transfers from your Mac are unaffected) - the higher you say your network speed is the more memory allocated and thus the higher the maximum speed is. The Retry Count and Retry Timeout are used for looking for other servers when a user logs in. If you have a small/fast network then use small numbers; if you have a large/slow network then use big numbers. The time taken is roughly proportional to the product of the two numbers.
When you have finished setting up the privileges, you can create or edit the files in the ╥Startup Messages╙ folder (which may reside either in FTPd╒s folder or in the ╥FTPd Preferences ─╙ folder in the Preferences folder). The files in the Startup Messages folder will be returned when the user with that name logs in. So for example the ╥Peter Startup╙ file will be returned to the user named ╥Peter╙ when he logs in, and the ╥Anonymous Startup╙ file will be returned when a user logs in as either ╥ftp╙ or ╥anonymous╙. If a file doesn╒t exist for the user, the file ╥Default Startup╙ will be used instead if it exists. Also, you can put a file ╥!Folder Info╙ in any folder and it will be displayed to the user when they change into that directory. The files should be text-only (and may be converted to ISO 8859-1 or 7-bit ASCII before being sent), and should be hard word wrapped to 70 columns. Note that some clients may not display this information. NOTE: At most 5k is returned at one time, so restrict your files to reasonable sizes. If you want to have the file listing of your site available (or any other large file), put the listing into a file, and then refer to that file in your Startup or Folder Info files.
The gopher server simply uses the Guest access of AppleShare to define the visible files and folders. As well, you can use the Gopher Listing menu item to change the names of files, and to add links to other gopher servers. The best way of adding links is to use TurboGopher to find the place you want to link to, and add it to your bookmarks file, then export that. FTPd Setup will let you add those bookmarks into a folder, you can then edit them to change the names, or remove some of the links. You can also add an index entry, which will let the user find files by specifying part of the name.
If you are running FTPd on a server or other dedicated Mac, you may prefer to run it in the foreground, instead of as a background only app. It will get a little more processing time, and be able to display the log file in real time.
Ñ Using FTPd
First, make sure that your AppleShare privileges are set up correctly. Tom Daley reported to me that he had someone try to access his machine within THREE minutes of first launching FTPd! So don╒t think you╒ll be safe if you╒re quick!
To use FTPd, simply put an alias to it in the Startup Folder and launch it. After that it will run in the background and allow users to connect to your Mac from anywhere in the world. You can then use any FTP client (eg Fetch or XferIt on Macs, or the standard Un*x ftp program) to access your Mac. For information on how to use them, see their respective documentation. Versions of Fetch after 2.1b2 recognize FTPd and display full file/directory information. If you are also running NCSA/Telnet, make sure to disable it╒s FTP server in the config.tel file or people will (randomly) get either it╒s server or FTPd. You can Quit FTPd by launching FTPd Setup and holding the option key down while you quit it.
As an extra feature, if a file ╥thefile╙ (for example) exists on the mac, then you can issue the following commands to get different formats of that file:
Note: All of these examples assume you're using the standard Un*x ftp client. If you're using some other system consult its documentation for the equivalent commands. BTW, when using the Un*x ftp client watch out for usernames with spaces in them. If you type ╥user fred bloggs╙ it thinks the username is fred and the password is bloggs, instead type ╥user "fred bloggs"╙.
get thefile - get the file in the current transfer mode.
get thefile.data - retrieves the data fork (in ASCII or binary).
get thefile.rsrc - get the resource fork of the file (binary mode only).
get thefile.info - get the info fork of the file (binary mode only)
(the info fork is the same format as the first 128 bytes of the MacBinary file).
get thefile.hqx - get the file after converting it to BinHex format.
get thefile.bin - get the file after converting it to MacBinary format
(you can also use .mb, .macbin, .macbinary) (binary mode only).
Also, you can put binhex or macbinary files and they will be converted automatically:
put thefile.hqx - put the file after converting it from BinHex format.
put thefile.bin - put the file after converting it from MacBinary format.
(you can also use .mb, .macbin, .macbinary) (binary mode only).
The dir command also support various unix-like flags, including CspFl (for columnar display, display size in k, display directories with a / on the end, and long display), eg:
dir -CF
If you are logged in as the owner, you can mount extra volumes after startup by using the ╥SMNT╙ command like this:
quote smnt volume:server@zone:username:password
@zone defaults to @*, and the username and password default to your loging username and password (this is a slight security risk, but you shouldn't leave any ftp connection unattended any more than you would leave a telnet connection unattended, so it should not be a problem). So to mount HardDisk on machine TheMac in your zone, using your username and password, you can type:
quote smnt HardDisk:TheMac
FTPd also supports the ╥MACB╙ command in the same way NCSA Telnet does.
quote macb e - turns macbinary transfer mode on
quote macb d - turns macbinary transfer mode off
Other special features are:
quote site u - display current usage stats (memory, connection, users, etc)
quote site s - use short (8.3) names. Looks like a PC (yuck)
quote site l - use long (31 character) names. Much better (default)
quote site h [e|d] - enable/disable adding ╥.hqx╙ to the end of all files in directory listings.
quote site q - quit the server (the user must be the owner).
quote site t [i|7|n] - set character translation to ISO 8859-1, 7-bit, or no translation.
quote site f <search>
or
quote site index <search> - list the files that contain <search> in their name.
Caveat: This doesn╒t work for AppleShare 2.0.* volumes. Also, it only uses long (31 character) names, irrespective of the short/long setting.
quote site p <password> - change your password. You must issue this three times in succession without any intervening commands, the first one with your old password as a parameter, and the next two with your new password. This will change your password on all currently logged in servers.
quote site c p <rwxr-x---> <directory> - set the permissions for a directory.
quote site c o <owner> <directory> - set the owner of a directory (the owner name cannot have any spaces in it - sorry).
quote site c o <group> <directory> - set the group of a directory (the group name cannot have any spaces in it). You can use "none" as a group name to set it to no group.
Also, you can use pattern matching in the cd command (only as the last directory specifier though). Eg:
cd "/HD/System Folder"
cd /HD/System?Folder
cd /HD/syst*
cd /HD/Sys*fol*
You can use remotehelp to find out some information on the other commands.
remotehelp
remotehelp pass
remotehelp site
remotehelp "site f"
The multiline response returned by the login command sequence, the cd command and the help command may confuse some old FTP clients. This feature can be disabled by inserting a dash ╥-╙ before either your username or password (which means you will have to put an extra dash before any username or passwords which start with a dash, but that╒s probably not a problem :-)
A log file named ╥FTPd Log╙ is kept in the Preferences folder that records who logged in or out and when, as well as what files the put or get. Make sure you enable logging in FTPd Setup if you want a log file.
Ñ Gopher
FTPd now also supports the gopher protocol, a reasonably new protocol, mainly designed to simplify anonymous ftp. You can get several Mac clients for Gopher, including TurboGopher, available from the usual places.
To allow gopher access to your machine you need to enable gopher in FTPd Setup╒s preferences window, as well as enabling Guest access via AppleShare (since Gopher is effectively a gateway to anonymous (guest) ftp).
You can also add links from your machine to other servers. The easiest way to do this is to use TurboGopher to find the destination location you wish to link to, and add it to your bookmarks file, then export the bookmarks to a file. Then go in to FTPd Setup, choose Gopher Listing and select your gopher directory. Click the Add BookMarks button and FTPd will insert all your bookmarks (you can delete any you don╒t want). While you╒re there, you might also like to click the Add Index button to add an index entry to the directory - users who connect to your gopher server can use this to search for files by name.
If you wish to make only one section of your anonymous ftp site visible via Gopher, you can set up a User Directory entry for user ╥Gopher╙, and that will be the root of the Gopher tree (remember to type the path in as it would appear to an anonymous ftp user). I have endevered to enforce this restriction, but you should not rely on this as a security feature. Note that aliases to files that are outside of this area will be allowed, but aliases to folders will fail (since the files within them will not be accessible). You can remove or reduce this restriction by creating a ╥GopherRoot╙ user that will specify the enforced restriction. For example:
Gopher directory is /shared/gopher/startpoint
GopherRoot directory is /shared/gopher
Then anyone with knowledge of the gopher protocol will be able to access guest-visible files inside /shared/gopher, but the normally displayed starting point for gopher access will be /shared/gopher/startpoint. Aliases inside there may point to folders anywhere inside /shared/gopher.
Ñ Security Considerations
╥Be afraid. Be very afraid╙ - The Fly
Allowing FTPd to run on your Mac poses huge security questions. Some of the same security questions are also posed by System 7 File Sharing. However with FTPd they are much worse because you╒re making your Mac accessible to everyone on a world wide network. Things you definitely should do:
Disable guest logins unless you actually need them. Most people don╒t. (Disable them in the <Any User> user in the Users & Groups folder, as well as in the FTPd Setup).
Note: You╒ll need guest logins enabled to allow gopher connections.
If you want a few people to have access, perhaps a better idea than guest login is to give them a single account with a shared password. This is more secure than guest logins, since no matter how many people they tell the password to, it will always be less than the number of people who could log in as guests.
Disable FTP to any Mounted, Server or Far Server volumes. Again, most people don╘t need access to volumes other than those directly on your Macintosh (That is the Entire Volume and Shared Folder volumes). You Definitely Should Not allow access to other volumes on the network if you do not control them, and you Definitely Should inform the administrators of any other servers on the network that you will be allowing access to them so that they can secure their servers as well.
Only share a small portion of your file system. That way you don╒t have to worry about the rest of it. You, as the owner, can still get access to it by turning the See Entire Volume checkbox on for your user in the Users & Groups info.
Verify that the file sharing privileges are set correctly. A good start is to change everything to owned by you and only visible/modifiable by you. Then change the privileges on areas that you want to give users and guests access.
Keep your password secure! Anyone on the Internet with your username, machine address and password will likely be able to delete every file on your harddisk. This is a scary thought. You should be scared. Don╒t give your password out and don╒t use an obvious password. Obvious passwords include, but are not limited to, any of the following patterns (in decreasing obviousness)...
Ñ your user name.
Ñ your real name.
Ñ your initials.
Ñ any of the above backwards.
Ñ your husband╒s/wife╒s/girlfriend╒s/boyfriend╒s/dog╒s/frog╒s/machine╒s etc name.
Ñ your car licence plate, make, model, etc.
Ñ your birthday.
Ñ your student/MediCare/social security/tax file/etc number.
Ñ any of the above backwards.
Ñ any word from a dictionary (especially an electronic dictionary).
Good passwords can be found by making up nonsense words or using the first
letters from a common saying and by including non-alphanumeric ASCII
characters.
Invalid login attempts are logged to a log file in the Preferences folder (assuming logging is enabled). Turn logging on and check the log file regularly to improve your security.
If in doubt, don╒t run FTPd. I can╒t accept any liability for any problems. I have done my best to make sure it is secure. If that is not good enough, don╒t use it. It╒s as simple as that.
Ñ How to Avoid Being Killed by your Network Administrator
FTP uses a lot of bandwidth and so you should check with the system administrators on your network before setting up an FTP site for anything more than personal use.
Also, since FTPd can make other servers on the entire AppleTalk internet available for FTP, you should ensure that the administrators of such machines (including anyone who has File Sharing enabled on their mac) are aware of this before you allow FTP access to Mounted, Server or Far Server volumes.
I can╒t accept any responsibility if you use this software in an irresponsible manner (in fact I won╒t accept any responsibility not matter how you use this software!). As long as you disable Mounted, Server and Far Server volume access and don╒t try to become the next Info-Mac archive, it shouldn╒t be much of a problem, but check with your network administrators anyway.
Ñ Limitations
FTPd & FTPd Setup require System 7 with File Sharing turned on, MacTCP 1.1 (or later perhaps?), probably require the 128k ROM (or later). FTPd will can only deal with the first 200 files/folders in a directory, and only the first 200 matches in the SITE F command.
Ñ Small Print
This program is Shareware, which means if you use it, and you╒d like me to write more useful things, then you should send me $10 (US or Australian). For individual registrations, you might as well just send cash, but I can accept checks drawn on US bank accounts without any problem.
Site Licensing:
World-wide license: US$1000
Foreign universities or companies site license: US$250
Australian universities or companies site license: AU$250 (none yet)
Curtin University and the University of Western Australia are exempt.
Individuals: AU or US $10.
There is no upgrade fee, if you registered a previous version, that registration remains valid. The price has gone up a little since version 1 (see, you should have registered earlier!).
I╒ve read through the Guide for Shareware Authors. According to them, I am doing everything wrong. I should put a large price tag on my software because the people who pay will pay whether or not I put a large price tag, and the people who won╒t pay, won╒t pay no matter what the price is. This seems to be to be totally negative reinforcement - I╒d hurt those who do the right thing by me, and have no effect on the rest. I╒m not going to do that, at least not yet. So I╒m not going to get rich, which is a shame because I╒d much rather go back to writing free software.
Note that I'd prefer that you use the program and send me a note saying so, than not use the program at all! (it doesn╒t help either of us if you delete it and don╒t pay) So even if you are not willing to send me any money, still drop me a line and say hi and tell me what you like or don't like about this program. Of course, I╒d prefer you to pay, obviously. Better yet, get your organisation to buy a site license.
You may distribute FTPd&FTPd Setup any way you wish as long as you don't charge for it (reasonable download costs such as Compu$erve are ok I guess (although who would call Compu$erve╒s download costs reasonable?)). It would probably be a good idea to keep this documentation file with the program, but I╒m hardly likely to check up on you now am I! I don╒t guarantee any support, but I always answer my Email. If I don╒t answer Email its because your message didn╒t get to me, or my reply bounced (so try again, and include a valid internet address if you can).
FetchNews 1.0.0b - Fetch News for use with NewsWatcher╒s demo mode.
MacTCP Watcher 1.1.0 - Display MacTCP╒s state information.
Bolo Finder 1.0.2 - Display the results from Mike Ellis' Bolo Tracker.
Bolo RandomMap 1.1.0 - Generate a random map for Bolo.
French versions of some of my programs may be available from ftp.sri.ucl.ac.be:/pub.
You can sometimes get the latest development versions from redback.cs.uwa.edu.au:/others/peterlewis, but please use the major archives for released version if at all possible. Redback is a long long way from most people, and using it wastes bandwidth on the Australian-US satelite link which is overly congested already. So use the versions posted to the archives (like sumex-aim.stanford.edu or mac.archive.umich.edu), and only use the development versions if you have some specific problem - in which case tell me, especially since the development versions on redback are often not the latest versions I have)
Send postcards, comments, bug reports, wishes, and payments to: